<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<link rel="stylesheet" href="mystyle.css">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Register New User</title>

<script language="JavaScript" type="text/javascript">
function doValidation() {
	 var rollNor = document.getElementById("rollNor").value;
	 var userName = document.getElementById("username").value;
	 var password = document.getElementById("password").value;
	 var dob = document.getElementById("dob").value;
	 var emailId = document.getElementById("emailId").value;
	 var image = document.getElementById("image").value;
	 if (rollNor==""||username==""||password==""||dob==""||emailId=="")
		{
		alert("None of the fields should be left blank!");
		return false;
		}
	    
	 return true;
}
</script>

</head>


<body>

<s:form action="register">

<center><h2>Register New User</h2></center>
<td><table id="text">
	 <td><s:textfield name="rollNor" label = "Roll No" id="rollNor" size="20" /></td>
	 <td><s:textfield name="username" label = "User Name" id="username" size="20" /></td>
	 <td><s:textfield name="password" label = "Password" id="password" size="20" /></td>
	 <td><s:textfield name="dob" label = "DOB (Enter yyyy-mm-dd)" id="dob" size="20" /></td>
	<td><s:textfield name="emailId" label = "Email ID" id="emailId" size="20" /></td>
   <!--  <td><s:textfield name="image" label = "Image" id="image" size="20" /></td> -->
     <s:file name="image" label="User Image" />
    <s:submit name = "commandButton" method="execute" id="mysubmit" value="Upload" align="center" />
    
    </tr>
</table></td>

<s:submit name = "commandButton" method="execute" id="mysubmit" value="Register" onClick="return doValidation()"
 align="center" />
 </s:form>
 
</body>
</html>